package com.hzx.service.impl;

import com.hzx.dao.CommodityMapper;
import com.hzx.dao.OrderMapper;
import com.hzx.dao.RecommandMapper;
import com.hzx.pojo.Commodity;
import com.hzx.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ItemServiceImpl implements ItemService {

    @Autowired
    private CommodityMapper commodityMapper ;

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public List getAllReCommand() {
        return null;
    }

    @Override
    public Commodity getItemByPrimaryKey(long cid) {
        return null;
    }

    @Override
    public Integer selectByKindId(long id) {
        return 0;
    }

    @Override
    public List getAllItems() {
        return commodityMapper.AllCommodity();
    }

    @Override
    public List getAllItemsByUid(Integer uid) { return  commodityMapper.selectCommodityByUid(uid);}

    @Override
    public  List getAllDemandByUid(Integer uid) { return  orderMapper.selectOrderByUid(uid); }

    @Override
    public Integer getNumbsByKindId(Integer id) {
        return commodityMapper.getNumbsByKindId(id);
    }

    @Override
    public List selectByKidAndPrice(Integer kid, Integer lo, Integer he) {
        return commodityMapper.selectByKidAndPrice(kid,lo,he);
    }

}
